//
//  SYColorViewController.m
//  SanYiTeaching
//
//  Created by 郑浩然 on 2019/9/24.
//  Copyright © 2019年 SanYi. All rights reserved.
//

#import "SYColorViewController.h"
#import "SYColorImageView.h"


@interface SYColorViewController ()
@property (strong, nonatomic) SYColorImageView *colorImageView;

@property (strong, nonatomic) UIColor *color;
@property (weak, nonatomic) IBOutlet UILabel *brushColorLab;




@end

@implementation SYColorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.colorImageView = [[SYColorImageView alloc] initWithFrame:CGRectMake(50,80,100,100)];
    [self.view addSubview:self.colorImageView];
    
    __weak typeof(self) weakSelf = self;
    self.colorImageView.currentColorBlock = ^(UIColor *color){
        weakSelf.color = color;
        weakSelf.brushColorLab.textColor = color;
    };
    
}
- (IBAction)determineBtnClick:(UIButton *)sender {
    if (self.syColorBlock) {
        self.syColorBlock(self.color);
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
